<?php include template("header");?>

<div id="bdw" class="bdw">
<div id="bd" class="cf">

<!--<?php if(is_newbie()){?><div id="sysmsg-guide"><div class="link"><a href="/help/tour.php"></a></div><a id="sysmsg-guide-close" href="javascript:void(0);" class="close">关闭</a></div><?php }?>-->

<?php if($team['close_time']){?>
<div id="sysmsg-tip" class="sysmsg-tip-deal-close"><div class="sysmsg-tip-top"></div><div class="sysmsg-tip-content"><div class="deal-close"><div class="focus">抱歉，您来晚了，<br />活动已经结束啦。</div><div id="tip-deal-subscribe-body" class="body"><form id="tip-deal-subscribe-form" method="post" action="/subscribe.php" class="validator"><table><tr><td>不想错过其他的活动？立刻订阅每日最新活动信息：&nbsp;</td><td><input type="text" name="email" class="f-text" value="" require="true" datatype="email" /></td><td>&nbsp;<input class="commit" type="submit" value="订阅" /></td></tr></table></form></div></div><span id="sysmsg-tip-close" class="sysmsg-tip-close">关闭</span></div><div class="sysmsg-tip-bottom"></div></div>
<?php }?>

<?php if($order){?>
<div id="sysmsg-tip" ><div class="sysmsg-tip-top"></div><div class="sysmsg-tip-content">您已经获取过本券，但还没有完成同步消息操作。<a href="/team/buy.php?id=<?php echo $team['id']; ?>">继续之前操作</a><span id="sysmsg-tip-close" class="sysmsg-tip-close">关闭</span></div><div class="sysmsg-tip-bottom"></div></div><div id="deal-default"> 
<?php }?>

	<div id="deal-default">
		<div id="content">
			<div id="deal-intro" class="cf">
				<h1>
					<?php if($team['close_time']==0){?>
					<a class="deal-today-link" title="点击获取优惠！" <?php echo $team['begin_time']<time()?'href="/team/buy.php?id='.$team['id'].'"':''; ?>>
						<?php echo $partner['title']; ?>:
					</a>
					<?php }?>
					<?php echo $team['title']; ?>
				</h1>
				<div class="main">
					<div class="cp" style="margin:0 50px;">
						<p class="badge" style="cursor: hand; cursor: pointer;z-index:10;">
							<?php echo $team['discount_rate']; ?><?php echo $currency; ?>
						</p>
						<div class="prodWrap">
							<a href="/team.php?id=<?php echo $team['id']; ?>" title="<?php echo $team['title']; ?>" target="_blank">
								<img class="ci_css_img" src="<?php echo team_image($partner['logo']); ?>" width="250" height="100" alt="<?php echo $team['discount_rate']; ?><?php echo $currency; ?>">
							</a>
						</div> 
						<div class="bar">
							<p class="join_num_and_end_time" style="display:none;">
								<span class="join_number"><?php echo $team['now_number']; ?>人已参加</span>
								<span class="end_time"><?php echo date('Y-m-d',$team['end_time']); ?>截止</span>
							</p>
							<p class="left_time_p" countdown="<?php echo $team['end_time']-time(); ?>">
								<span><?php echo $team['title']; ?></span>
							</p>
							<a href="/team.php?id=<?php echo $team['id']; ?>" target="_blank">
								<p class="clip" style="display:none;"></p>
							</a>
						</div>
					</div>
				</div>
				
                <div class="side">
					<?php if($team['close_time']==0){?>
						<?php if($team['now_number']==0){?>
						<div class="join_num">
							<p>新活动上线！</p>
						</div>
						<?php } else { ?>
						<div class="join_num">
							<p>参与人次：&nbsp;<strong><?php echo $team['now_number']; ?></strong></p>
							<?php if($team['max_number']!=0){?><p>优惠总量：&nbsp;<strong><?php echo $team['max_number']; ?></strong></p><?php }?>
							<p>剩余时间：&nbsp;
								<?php if($left_day>0){?>
								<strong><?php echo $left_day; ?></strong>天<strong><?php echo $left_hour; ?></strong>小时<strong><?php echo $left_minute; ?></strong>分钟
								<?php } else { ?>
								<strong><span><?php echo $left_hour; ?></strong>小时<strong><?php echo $left_minute; ?></strong>分钟<strong><?php echo $left_time; ?></strong>秒
								<?php }?>
							</p>
						</div>
						<?php }?>
					<?php } else { ?>
					<div class="join_num"><div class="deal-buy-<?php echo $team['state']; ?>"></div><p>共有 <strong><?php echo $team['now_number']; ?></strong> 人参加</p></div> 
					<?php }?>
				
					<?php if($team['close_time']==0){?>
					<div class="join_num click-to-buy">
						<p>
							<a title="点击获取优惠！" <?php echo $team['begin_time']<time()?'href="/team/buy.php?id='.$team['id'].'"':''; ?>>
								&nbsp;&nbsp;点击即得：<?php echo $team['discount_rate']; ?><?php echo $currency; ?>！
							</a>
						</p>
					</div>
					<div class="join_num">
					<script type="text/javascript" charset="utf-8">
						(function(){
						  var param = {
							url:location.href,
							appkey:'1', /**您申请的应用appkey,显示分享来源(可选)*/
							title:'' /**分享的文字内容(可选，默认为所在页面的title)*/
						  }
						  var temp = [];
						  for( var p in param ){
							temp.push(p + '=' + encodeURIComponent( param[p] || '' ) )
						  }
						  document.write('<iframe allowTransparency="true" frameborder="0" scrolling="no" src="http://test.com/free/connect/show_share_btn.php?' + temp.join('&') + '"></iframe>')
						})()
					</script>
					</div>
					<?php }?>
				</div>
            </div>
            <div id="deal-stuff" class="cf">
                <div class="clear box box-split">
                    <div class="box-top"></div>
                    <div class="box-content cf">
                        <div class="main">
						<?php if(trim(strip_tags($team['detail']))){?>
                            <h2 id="detail">活动详情</h2>
							<div class="blk detail"><?php echo $team['detail']; ?></div>
						<?php }?>
						<?php if(trim(strip_tags($team['notice']))){?>
							<h2 id="detailit">特别提示</h2>
							<div class="blk cf"><?php echo $team['notice']; ?></div>
						<?php }?>
						<?php if(trim(strip_tags($team['userreview']))){?>
							<h2 id="userreview">他们说</h2>
							<div class="blk review"><?php echo userreview($team['userreview']); ?></div>
						<?php }?>
						<?php if(trim(strip_tags($team['systemreview']))){?>
							<h2 id="systemreview"><?php echo $INI['system']['abbreviation']; ?>说</h2>
							<div class="blk review"><?php echo $team['systemreview']; ?></div>
						<?php }?>
						</div>
                        <div class="side">
                            <div id="side-business">
								<h2><?php echo $partner['title']; ?></h2>
								<div style="margin-top:10px;"><?php echo $partner['address']; ?></div>								
								<div style="margin-top:10px;">联系电话：<?php echo $partner['phone']; ?></div>
								<div style="margin-top:10px;"><a href="<?php echo $partner['homepage']; ?>" target="_blank"><?php echo domainit($partner['homepage']); ?></a></div>
								<div id="map_canvas" style="padding: 0px; margin: 0px; height: 200px; width: 200px;"></div>
								<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
								<script type="text/javascript">
									var myLatlng = new google.maps.LatLng(<?php echo $partner['latitude']; ?>, <?php echo $partner['longitude']; ?>);
									var myOptions = {
										zoom: 15,
										center: myLatlng,
										mapTypeId: google.maps.MapTypeId.ROADMAP
									};
									var myMap = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
									var marker = new google.maps.Marker({
										position: myLatlng,
										title:"<?php echo $partner['title']; ?> - <?php echo $partner['address']; ?>",
										map: myMap
									});
								</script>
								<?php if(($partner['location'] != '') && ($partner['location'] != null)){?>
								<h2>交通指南</h2>
								<div style="margin-top:10px;"><?php echo $partner['location']; ?></div>
								<?php }?>
							</div>
						</div>
                        <div class="clear"></div>
                    </div>
                    <div class="box-bottom"></div>
                </div>
            </div>
    </div>
    <div id="sidebar">
		<?php include template("block_side_network_weight");?>
		<?php include template("block_side_invite");?>
		<?php include template("block_side_bulletin");?>
		<?php include template("block_side_flv");?>
		<?php include template("block_side_ask");?>
		<?php include template("block_side_others");?>
		<?php include template("block_side_business");?>
		<?php include template("block_side_subscribe");?>
	</div>
</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->

<?php include template("footer");?>